fix(cli): accept text and octet-stream in the upload allowlist - #2813
Open
ryanthegentry wants to merge 1 commit into
Open
fix(cli): accept text and octet-stream in the upload allowlist#2813ryanthegentry wants to merge 1 commit into
ryanthegentry wants to merge 1 commit into
Conversation
`buzz upload file` rejects any file whose sniffed MIME is not an image or mp4, but it uploads to the relay's BUD-02 `/upload` endpoint, and that endpoint routes non-media attachments — docs, archives, text, data — through `process_file_upload` and stores them. The CLI is stricter than the endpoint it posts to, so a plain-text file the relay would accept fails client-side with "unsupported file type: application/octet-stream" and never leaves the machine. `infer` has no plain-text matcher, so a text file arrives at the check as `application/octet-stream`; that entry is what unblocks it, and `text/plain` is added alongside for the paths where a text MIME is known. Adds a unit test asserting both entries so the widening is not silently reverted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
buzz upload filerejects any file whose sniffed MIME is not an image or mp4, but it uploads to the relay's BUD-02/uploadendpoint, and that endpoint routes non-media attachments (e.g. docs, archives, text, data) throughprocess_file_uploadand stores them. The CLI is stricter than the endpoint it posts to, so a plain-text file the relay would accept fails client-side with "unsupported file type: application/octet-stream" and never leaves the machine.inferhas no plain-text matcher, so a text file arrives at the check asapplication/octet-stream; that entry is what unblocks it, andtext/plainis added alongside for the paths where a text MIME is known.Adds a unit test asserting both entries so the widening is not silently reverted.